﻿<UserControl x:Class="MediaSurface.SearchUserControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    MaxHeight="490"  Background="Transparent" MinHeight="490"  MaxWidth="890" MinWidth="870" xmlns:my="http://schemas.microsoft.com/surface/2008" Margin="20" Padding="5" Height="360" Width="760" Opacity="1">
    
    <UserControl.Resources>
        <ImageBrush x:Key="WindowBackground" Stretch="Fill" Opacity="1" ImageSource="pack://application:,,,/Resources/16.jpg
                "/>

        <Style x:Key="LibraryControlInScatterViewItemContentStyle" TargetType="{x:Type my:ScatterViewItem}">
            <Setter Property="MinWidth" Value="{Binding Path=Content.MinWidth, RelativeSource={RelativeSource Self}, Mode=OneWay}"/>
            <Setter Property="MinHeight" Value="{Binding Path=Content.MinHeight, RelativeSource={RelativeSource Self}, Mode=OneWay}"/>
            <Setter Property="MaxWidth" Value="{Binding Path=Content.MaxWidth, RelativeSource={RelativeSource Self}, Mode=OneWay}"/>
            <Setter Property="MaxHeight" Value="{Binding Path=Content.MaxHeight, RelativeSource={RelativeSource Self}, Mode=OneWay}"/>
            <Setter Property="IsActive" Value="{Binding Path=Content.IsActive,RelativeSource={RelativeSource Self}, Mode=OneWayToSource}"/>
            <Setter Property="Width" Value="{Binding Path=Content.Width, RelativeSource={RelativeSource Self}, Mode=TwoWay}"/>
            <Setter Property="Height" Value="{Binding Path=Content.Height, RelativeSource={RelativeSource Self}, Mode=TwoWay}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type my:ScatterViewItem}">
                        <ContentPresenter />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="BarItemStyle" TargetType="{x:Type my:LibraryBarItem}">
            <Style.Triggers>
                <Trigger Property="my:LibraryBarItem.IsItemDataEnabled" Value="False">
                    <Setter Property="my:LibraryBarItem.Padding" Value="5"/>
                    <Setter Property="my:LibraryBarItem.Background" Value="Blue"/>
                </Trigger>
            </Style.Triggers>
        </Style>



    </UserControl.Resources>
    
    <DockPanel Height="410" Width="783">
            <Label DockPanel.Dock="Top" HorizontalAlignment="Center" FontWeight="Bold" Foreground="Tomato" FontSize="15">Media Library</Label>

            <my:LibraryBar DockPanel.Dock="Top"    Name="libraryBar2" Width="760" Height="196" Rows="1" AllowDrop="False" ItemContainerStyle="{StaticResource BarItemStyle}" Margin="6">

                    <my:LibraryBar.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Name="infoView">
                                <Image Name="thumnailImage" Width="120"  Margin="5" Source="{Binding Path=thumbnailUrl}"></Image>

                                
                                <TextBlock Width="140" HorizontalAlignment="Center" Foreground="Yellow" Text="{Binding Path=title}" TextWrapping="Wrap"></TextBlock>
                                                            
                            </StackPanel>
                        </DataTemplate>                                

                    </my:LibraryBar.ItemTemplate>
            
            </my:LibraryBar>
        <my:SurfaceButton Name="searchButton" VerticalAlignment="Center" HorizontalAlignment="Center" Width="100" Height="40" DockPanel.Dock="Top" Click="SurfaceButton_Click" FontSize="12" FontWeight="Bold"> Search</my:SurfaceButton>
        <my:SurfaceButton Name="hideSearchButton" VerticalAlignment="Center" HorizontalAlignment="Center" Width="100" Height="40" DockPanel.Dock="Top" Click="Hide_SurfaceButton_Click" FontSize="12" FontWeight="Bold" ForceCursor="False" Foreground="Black">Hide</my:SurfaceButton>

        <Border Name="SearchBorder" DockPanel.Dock="Top" BorderThickness="3" BorderBrush="Crimson" CornerRadius="30" Height="130" Width="574" Background="Transparent" ForceCursor="True">

            <StackPanel Name="SearchStackPanel" Height="180" Width="707"  DockPanel.Dock="Bottom" Margin="5" Orientation="Horizontal" VerticalAlignment="Center">
                <Label VerticalAlignment="Center" Foreground="red" FontWeight="Bold">Search</Label>
                
                <my:SurfaceListBox Margin="3"  Background="Transparent" Height="100" Width="150"  Foreground="Yellow" Name="searchOptionSurfaceListBox" ScrollViewer.HorizontalScrollBarVisibility ="Disabled" ScrollViewer.VerticalScrollBarVisibility="Visible" AllowDrop="False" VerticalAlignment="Center" SelectionChanged="searchOption_ListBoxChanges"  FontSize="11" FontWeight="Bold" ForceCursor="False" Grid.IsSharedSizeScope="True" HorizontalAlignment="Center" HorizontalContentAlignment="Left" MaxHeight="Infinity" ToolTip="Select to Search">
                    <my:SurfaceListBoxItem Foreground="Yellow" Height="20" Name="surfaceListBoxItem1" Width="120">My Media</my:SurfaceListBoxItem>
                    <my:SurfaceListBoxItem Foreground="Yellow" Height="20" Name="surfaceListBoxItem6" Width="120">Friends Media</my:SurfaceListBoxItem>

                    <my:SurfaceListBoxItem Foreground="Yellow" Height="20" Name="surfaceListBoxItem2" Width="120">All</my:SurfaceListBoxItem>
                    <my:SurfaceListBoxItem Foreground="Yellow" Height="20" Name="surfaceListBoxItem3" Width="120">Letter</my:SurfaceListBoxItem>
                    <my:SurfaceListBoxItem Foreground="Yellow" Height="20" Name="surfaceListBoxItem4" Width="120">Tag</my:SurfaceListBoxItem>
                    <my:SurfaceListBoxItem Foreground="Yellow" Height="20" Name="surfaceListBoxItem5" Width="120">Title</my:SurfaceListBoxItem>
                    
                   
                </my:SurfaceListBox>
                    <my:SurfaceListBox Foreground="Yellow"  Height="100" Width="150" Name="surfaceListBox2" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Disabled"  AllowDrop="False" VerticalAlignment="Center" HorizontalAlignment="Right" SelectionChanged="surfaceListBox2_SelectionChanged" Background="Transparent" FontWeight="Bold"></my:SurfaceListBox>
                    <my:SurfaceTextBox Foreground="Black" Background="White"  Name="searchTextBox" Height="22" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Right" Width="180" TextChanged="searchTextBox_TextChanged" />

          </StackPanel>
            
            
     </Border>
        
     </DockPanel>
   
</UserControl>
